package com.company.shop;

import com.company.creature.Creature;

/**
 * @description:
 * @author: ZhaoYicong
 * @date: Created in 2020/4/27 17:17
 * @version: v1.0
 * @modified By:
 */
public class MpPotion extends Attribute {

    @Override
    public String getSay() {
        return "恢复100点的魔法值";
    }

    @Override
    public void show() {
        super.show();
    }

    @Override
    public void function(Creature creature) {
        int result=0;
        result=creature.getMp()+100;
        if(result>500){
            creature.setMp(500);
        }else{
            creature.setMp(result);
        }
        creature.setMoney(creature.getMoney()-this.getSmoney());

    }

    public MpPotion(int smoney, String id, String name) {
        super(smoney, id, name);
    }
}
